package com.gack.business.dao;

import java.util.Date;

import javax.persistence.Entity;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gack.helper.common.abstractobj.IdEntity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 
* @ClassName: StoreBookingDetail 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author (ZhangXinYu)  
* @date 2018年6月11日 下午2:52:04 
* @version V1.0
 */
@Getter
@Setter
@Entity
@NoArgsConstructor
public class StoreBookingDetail extends IdEntity{
	private String orderid;
	private String username;
//	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
//	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date reservedtime;
	private String status;		//1>>预约  2>>主动取消预约订单关闭  3>>预约超时订单关闭  4>>使用中  5>>主动发起结束订单 6>>订单预结算(已选择商务卡并扣除) 7 订单带已支付金额已确定选择支付渠道  8>>用户主动支付订单
	//private Integer reservedStatus;	//预约状态   0预约成功  1取消预约
	private String reservedreason;	//取消缘由
	
	public StoreBookingDetail(String id,String orderid,String username,Date reservedtime,String status,String reservedreason){
		this.setId(id);
		this.setOrderid(orderid);
		this.setUsername(username);
		this.setReservedtime(reservedtime);
		this.setStatus(status);
		this.setReservedreason(reservedreason);
	}
	public String getStatus(){
		if(this.status.equals("2") || this.status.equals("3")){
			this.setStatus("1");
		}else{
			this.setStatus("0");
		}
		return this.status;
	}
}
